<!--{*
/*
 * This file is part of EC-CUBE
 *
 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
 *
 * http://www.lockon.co.jp/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
*}-->

<script type="text/javascript">
// URLの表示非表示切り替え
function lfnDispChange(){
	inner_id = 'switch';

	cnt = form1.item_cnt.value;
	
	if(document.getElementById('disp_url1').style.display == 'none'){
		for (i = 1; i <= cnt; i++) {
			disp_id = 'disp_url'+i;
			document.getElementById(disp_id).style.display="";
	
			disp_id = 'disp_cat'+i;
			document.getElementById(disp_id).style.display="none";
			
			document.getElementById(inner_id).innerHTML = '	URL <a href="#" onClick="lfnDispChange();"> >> カテゴリ表示</a>';
		}
	}else{
		for (i = 1; i <= cnt; i++) {
			disp_id = 'disp_url'+i;
			document.getElementById(disp_id).style.display="none";
	
			disp_id = 'disp_cat'+i;
			document.getElementById(disp_id).style.display="";
			
			document.getElementById(inner_id).innerHTML = '	カテゴリ <a href="#" onClick="lfnDispChange();"> >> URL表示</a>';
		}
	}

}

</script>

<div id="alpha">
<div id="alpha-inner">
<!--▼SUB NAVI-->
<!--{include file=$tpl_subnavi}-->
<!--▲SUB NAVI-->
</div>
</div>



<div id="beta">
<div id="beta-inner">
<form name="search_form" id="search_form" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<input type="hidden" name="mode" value="search">
<!--{foreach key=key item=item from=$arrHidden}-->
<!--{if $key == 'campaign_id' || $key == 'search_mode'}-->
<input type="hidden" name="<!--{$key}-->" value="<!--{$item|escape}-->">
<!--{/if}-->
<!--{/foreach}-->
<div class="title_page">
<h2><!--{$tpl_subtitle}--></h2>
</div>



<!--検索条件設定テーブルここから-->
<div class="menuclass">
<table summary="検索条件設定">
<tr>
	<th>商品ID</th>
	<td><span class="red"><!--{$arrErr.search_product_id}--></span>
	<input type="text" name="search_product_id" value="<!--{$arrForm.search_product_id|escape}-->" size="30" class="box30" style="<!--{$arrErr.search_product_id|sfGetErrorColor}-->"/>
	</td>
	<th>規格名称</th>
	<td><span class="red"><!--{$arrErr.search_product_class_name}--></span>
	<input type="text" name="search_product_class_name" value="<!--{$arrForm.search_product_class_name|escape}-->" size="30" class="box30"style="<!--{$arrErr.search_product_class_name|sfGetErrorColor}-->" />
	</td>
</tr>
<tr>
	<th>商品コード</th>
	<td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code|escape}-->" size="30" class="box30" /></td>
	<th>商品名</th>
	<td><input type="text" name="search_name" value="<!--{$arrForm.search_name|escape}-->" size="30" class="box30" /></td>
</tr>
<tr>
	<th>カテゴリ</th>
	<td>
	<select name="search_category_id" style="<!--{if $arrErr.search_category_id != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}--><!--{/if}-->">
	<option value="">選択してください</option>
	<!--{html_options options=$arrCatList selected=$arrForm.search_category_id}-->
	</select>
	</td>
	<th>種別</th>
	<td><!--{html_checkboxes name="search_status" options=$arrDISP selected=$arrForm.search_status}--></td>
</tr>
<tr>
	<th>登録・更新日</th>
	<td colspan=3>
	<span class="red"><!--{$arrErr.search_startyear}--></span>
	<span class="red"><!--{$arrErr.search_endyear}--></span>
	<select name="search_startyear" style="<!--{$arrErr.search_startyear|sfGetErrorColor}-->">
	<option value="">----</option>
	<!--{html_options options=$arrStartYear selected=$arrForm.search_startyear}-->
	</select>年
		<select name="search_startmonth" style="<!--{$arrErr.search_startyear|sfGetErrorColor}-->">
		<option value="">--</option>
		<!--{html_options options=$arrStartMonth selected=$arrForm.search_startmonth}-->
		</select>月
			<select name="search_startday" style="<!--{$arrErr.search_startyear|sfGetErrorColor}-->">
			<option value="">--</option>
			<!--{html_options options=$arrStartDay selected=$arrForm.search_startday}-->
			</select>日〜
				<select name="search_endyear" style="<!--{$arrErr.search_endyear|sfGetErrorColor}-->">
				<option value="">----</option>
				<!--{html_options options=$arrEndYear selected=$arrForm.search_endyear}-->
				</select>年
					<select name="search_endmonth" style="<!--{$arrErr.search_endyear|sfGetErrorColor}-->">
					<option value="">--</option>
					<!--{html_options options=$arrEndMonth selected=$arrForm.search_endmonth}-->
					</select>月
						<select name="search_endday" style="<!--{$arrErr.search_endyear|sfGetErrorColor}-->">
						<option value="">--</option>
						<!--{html_options options=$arrEndDay selected=$arrForm.search_endday}-->
						</select>日
	</td>
</tr>
<tr>
	<th>ステータス</th>
	<td colspan="3">
	<!--{html_checkboxes name="search_product_flag" options=$arrSTATUS selected=$arrForm.search_product_flag}-->
	</td>
</tr>
</table><!--検索条件設定テーブルここまで-->
</div>



<h3>検索結果表示件数
<!--{assign var=key value="search_page_max"}-->
<span class="red12"><!--{$arrErr[$key]}--></span>
<select name="<!--{$key}-->" style="<!--{$arrErr[$key]|sfGetErrorColor}-->">
<!--{html_options options=$arrPageMax selected=$arrForm.search_page_max}-->
</select> 件
</h3>

<div class="btn_box">
<input type="submit" name="subm" value="この条件で検索する" />
</div>
</form>	



<!--{if count($arrErr) == 0 and ($smarty.post.mode == 'search' or $smarty.post.mode == 'delete')}-->
<!--★★検索結果一覧★★-->
<form name="form1" id="form1" method="post" action="<!--{$smarty.server.PHP_SELF|escape}-->">
<input type="hidden" name="mode" value="search">
<input type="hidden" name="product_id" value="">
<input type="hidden" name="category_id" value="">
<!--{foreach key=key item=item from=$arrHidden}-->
<input type="hidden" name="<!--{$key}-->" value="<!--{$item|escape}-->">
<!--{/foreach}-->	

<h3>検索結果一覧　<span class="reselt"><!--検索結果数--><!--{$tpl_linemax}-->件</span>&nbsp;が該当しました。</h3>

	<div class="searchit">
	<ul>
	<!--{if $smarty.const.ADMIN_MODE == '1'}-->
	<li><input type="button" name="subm" value="検索結果をすべて削除" onclick="fnModeSubmit('delete_all','','');" /></li>
	<!--{/if}-->
	<li>
	<a href="#" onclick="fnModeSubmit('csv','','');" >CSV DOWNLOAD</a>｜<a href="../contents/csv.php?tpl_subno_csv=product"> >>CSV出力項目設定</a>
	</li>
	</ul>
	</div>
	<!--{include file=$tpl_pager}-->



<!--{if count($arrProducts) > 0}-->
<!--検索結果表示テーブル-->
<div class="menuclass2">
<table summary="検索結果表示">
<tr>
	<th rowspan="2">商品ID</th><th rowspan="2">商品画像</th><th>商品コード</th><th>商品名</th><th>在庫</th><th rowspan="2">編集</th>
	<th rowspan="2">確認</th><!--{if $smarty.const.OPTION_CLASS_REGIST == 1}--><th rowspan="2">規格</th><!--{/if}--><th>削除</th>
</tr>
<tr>
	<th>価格(円)</th>
	<th><span id="switch">カテゴリ<a href="#" onClick="lfnDispChange();">＞URL表示</a></span></th>
	<th>種別</th>
	<th>複製</th>
</tr>
	<!--{section name=cnt loop=$arrProducts}-->
	<!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
	<!--{assign var=status value="`$arrProducts[cnt].status`"}-->
	<tr bgcolor="<!--{$arrPRODUCTSTATUS_COLOR[$status]}-->">
		<td rowspan="2" align="center"><!--{$arrProducts[cnt].product_id}--></td>
		<td rowspan="2" align="center">
		<!--{if $arrProducts[cnt].main_list_image != ""}-->
		<!--{assign var=image_path value="`$arrProducts[cnt].main_list_image`"}-->
		<!--{else}-->
		<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
		<!--{/if}-->
		<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path|sfRmDupSlash}-->&width=65&height=65">
		</td>
		<td><!--{$arrProducts[cnt].product_code|escape|default:"-"}--></td>
		<td><!--{$arrProducts[cnt].name|escape}--></td>
		<td align="center">
							<!--{* 在庫 *}-->
							<!--{if $arrProducts[cnt].stock_unlimited == '1'}-->
							無制限
							<!--{else}-->
							<!--{$arrProducts[cnt].stock|escape|default:"-"}-->
							<!--{/if}-->
		</td>
		<td align="center" rowspan="2">
		<span class="icon_edit">
		<a href="<!--{$smarty.const.URL_DIR}-->" onclick="fnChangeAction('./product.php'); fnModeSubmit('pre_edit', 'product_id', <!--{$arrProducts[cnt].product_id}-->); return false;" >編集</a>
		</span>
		</td>
		<td align="center" rowspan="2">
		<span class="icon_confirm">
		<a href="<!--{$smarty.const.SITE_URL|sfTrimURL}-->/products/detail.php?product_id=<!--{$arrProducts[cnt].product_id}-->&admin=on" target="_blank">確認</a>
		</span>
		</td>
			<!--{if $smarty.const.OPTION_CLASS_REGIST == 1}-->
			<td align="center" rowspan="2">
			<span class="icon_class">
			<a href="<!--{$smarty.const.URL_DIR}-->" onclick="fnChangeAction('./product_class.php'); fnModeSubmit('pre_edit', 'product_id', <!--{$arrProducts[cnt].product_id}-->); return false;" >規格</a>
			</span>
			</td>
			<!--{/if}-->
				<td align="center">
				<span class="icon_delete">
				<a href="<!--{$smarty.const.URL_DIR}-->" onclick="fnSetFormValue('category_id', '<!--{$arrProducts[cnt].category_id}-->'); fnModeSubmit('delete', 'product_id', <!--{$arrProducts[cnt].product_id}-->); return false;">削除</a>
				</span>
				</td>
	</tr>
	<tr bgcolor="<!--{$arrPRODUCTSTATUS_COLOR[$status]}-->">
							<td align="right">
							<!--{* 価格 *}-->
							<!--{if $arrProducts[cnt].price02 != ""}-->
							<!--{$arrProducts[cnt].price02|number_format}-->
							<!--{else}-->
							-
							<!--{/if}-->
							</td>
							<td class="small">
							<!--{* カテゴリ名 *}-->
							<div id="disp_cat<!--{$smarty.section.cnt.iteration}-->" style="display:<!--{$cat_flg}-->">
                            <!--{foreach from=$arrProducts[cnt].categories item=category_id name=categories}-->
                              <!--{$arrCatList[$category_id]|sfTrim}-->
                              <!--{if !$smarty.foreach.categories.last}--><br /><!--{/if}-->
                            <!--{/foreach}-->
							</div>

							<!--{* URL *}-->
							<div id="disp_url<!--{$smarty.section.cnt.iteration}-->" style="display:none">
							<!--{$smarty.const.SITE_URL|sfTrimURL}-->/products/detail.php?product_id=<!--{$arrProducts[cnt].product_id}-->
							</div>
							</td>
							<!--{* 表示 *}-->
							<!--{assign var=key value=$arrProducts[cnt].status}-->
							<td align="center"><!--{$arrDISP[$key]}--></td>
							<td align="center"><span class="icon_copy"><a href="<!--{$smarty.const.URL_DIR}-->" onclick="fnChangeAction('./product.php'); fnModeSubmit('copy', 'product_id', <!--{$arrProducts[cnt].product_id}-->); return false;" >複製</a></span></td>
						</tr>
						<!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
						<!--{/section}-->
						<input type="hidden" name="item_cnt" value="<!--{$arrProducts|@count}-->">
</table>
</div>
<!--検索結果表示テーブル-->
<!--{/if}-->
</form>

<!--★★検索結果一覧★★-->		
<!--{/if}-->
</div>
</div>
